﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using Microsoft.Kinect;

namespace Final_Project
{
    public class CDepthFileWriter
    {
        private string m_strPath;

        public CDepthFileWriter(string strPath)
        {
            m_strPath = strPath;
        }

        public void WriteDepthMapToFile(DepthImagePixel[] values, uint unIndex)
        {
            StreamWriter writer = new StreamWriter(m_strPath + unIndex);
            foreach (DepthImagePixel value in values)
            {
                writer.Write(value.Depth + " ");
            }
            
            writer.Close();
        } // WriteDepthValues

        public void WriteDepthShortsMapToFile(short[] values, uint unIndex)
        {
            StreamWriter writer = new StreamWriter(m_strPath + unIndex);
            foreach (short value in values)
            {
                writer.Write(value + " ");
            }

            writer.Close();
        } // WriteDepthValues
    }
}
